package list.test;

/**
 * @author PC
 * @date 2020/5/18
 * 浅拷贝
 */
public class ArrayListCloneTest2 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Student stu1 = new Student("豹子头林冲",30);
        Object o = stu1.clone();
        System.out.println(stu1 == o);
        System.out.println(stu1);
        System.out.println(o);
        System.out.println("此时不管修改哪个对象的内容，另外一个对象都不会受到影响");
        stu1.setAge(20);
        System.out.println(stu1);
        System.out.println(o);
    }
}
